﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Xajhzwb.Components.Util;
using Xajhzwb.Components.Data;

namespace Xajhzwb
{
    public partial class FormImpExp : Form
    {
        /// <summary>
        /// 导入或者导出
        /// </summary>
        private bool IsImport = false;
        private Const.ClassType ClassType;
        private int ID;

        public FormImpExp()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 画面初始化
        /// </summary>
        /// <param name="isImport"></param>
        public FormImpExp(bool isImport, Const.ClassType classType, int ID)
        {
            IsImport = isImport;
            ClassType = classType;
            ID = ID;

            InitializeComponent();

            if (isImport)
            {
                btnImpExp.Text = "导入";
                saveToolStripMenuItem.Visible = false;
                openToolStripMenuItem.Visible = true;
            }
            else
            {
                btnImpExp.Text = "关闭";
                saveToolStripMenuItem.Visible = true;
                openToolStripMenuItem.Visible = false;

                // 加载内容
                if (ClassType == Const.ClassType.Publish)
                {
                    PublishData publishData = DataHelper.GePublishData(ID);
                    setPublishData(publishData);
                }


            }
        }

        /// <summary>
        /// 导入导出
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnImpExp_Click(object sender, EventArgs e)
        {
            if (IsImport)
            {
                // 导入

            }
            else
            {
                // 关闭
                this.Close();
            }
        }

        /// <summary>
        /// 保存文件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        /// <summary>
        /// 打开文件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {




        }

        /// <summary>
        /// 退出
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void setPublishData(PublishData publishData)
        {



            

        }

    }
}
